<?php
/**
 * [PHPFOX_HEADER]
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author			Raymond Benc
 * @package 		Phpfox
 * @version 		$Id: template.html.php 5971 2013-05-28 08:18:19Z Raymond_Benc $
 */
 
defined('PHPFOX') or exit('NO DICE!'); 

?>{if !PHPFOX_IS_AJAX_PAGE}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="{$sLocaleDirection}" lang="{$sLocaleCode}">
	<head>
     {if Phpfox::isUser()}
        <link type="text/css" rel="stylesheet" id="arrowchat_css" media="all" href="arrowchat/external.php?type=css" charset="utf-8" />
		<script type="text/javascript" src="arrowchat/includes/js/jquery.js"></script>
		<script type="text/javascript" src="arrowchat/includes/js/jquery-ui.js"></script>
     {/if}
		<title>{title}</title>
		{header}
	   {php}
       if($_REQUEST['popup']=='1'){
       		echo '
            <link rel="stylesheet" href="/theme/frontend/nebula/style/nebula/css/popup.css">
            <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>';
		}
       {/php}
       
	</head>

	<body>
    

	<div{if !Phpfox::isUser()} id="nb_body_holder_guest"{elseif defined('PHPFOX_IN_DESIGN_MODE')} id="nb_in_design"{/if}>
			{body}	
			{block location='9'}
		
			<div id="header" {if !Phpfox::isUser()}class="nouser"{/if}>
			
				<!--{if !Phpfox::isUser()}
				{if Phpfox::getParam('user.hide_main_menu')}
                <div class="holder">
					<div id="nb_header_menu" >
                        <div class="holder">
                            
                            <div class="clear"></div>
                        </div>
					</div>	
				{else}-->
				
				<!--{/if}
				{/if}		
				-->
                
				
                    
                    
					{block location='10'}
                    <div id="header_holder" {if !Phpfox::isUser()}  class="header_logo"{/if}>				
						<div class="lang-custom">                    		
                    		<a href="#" onclick="$('#js_language_package_holder').hide(); $('#js_loading_language').html($.ajaxProcess('Loading')); $.ajaxCall('language.process', 'id=en'); return false;"><img src="theme/frontend/nebula/style/nebula/image/layout/en.png" border="0" /></a>
                    		<a href="#" onclick="$('#js_language_package_holder').hide(); $('#js_loading_language').html($.ajaxProcess('Loading')); $.ajaxCall('language.process', 'id=vi'); return false;"><img src="theme/frontend/nebula/style/nebula/image/layout/vi.png" border="0" /></a>
                    	</div>
						
						<div id="menutop">
							{menu}
	                    	<div id="categorytop">
		                        {foreach from=$categories name=categories item=acategory}
		                        	<div class="acategory-item" >                                                              
                                    <a id="marketplace_cateid_{$acategory.category_id}" class="{if $acategory.category_id == $currentCat}menu_is_selected{/if}"  href="{$acategory.url}">{$acategory.name}</a></div>
		                        {/foreach} 
	                        </div>
                    	</div>
                    	
						{block location='6'}
						
						<div class="clr"></div>
                    	<div id="header_left">
							<!--{logo}-->
                            {if Phpfox::isUser()}
                            <a href="/" id="logo"><img src="theme/frontend/nebula/style/nebula/image/layout/logocfae-home.png" border="0" /></a>
                            {/if}
                            {if !Phpfox::isUser()}
                            <a href="/" id="logo"><img src="theme/frontend/nebula/style/nebula/image/layout/logocfae-home.png" border="0" /></a>
                            {/if}
						</div>
                    	
                    	<div id="header_right">
							<div id="header_top">
								{if Phpfox::isUser() && !Phpfox::getUserBy('profile_page_id') && Phpfox::isModule('search')}

									<div id="header_search">	
										<div id="header_menu_space">
											<div id="header_sub_menu_search">
												<form method="post" id='header_search_form' action="{url link='search'}">																						
													<input type="text" name="q" value="{phrase var='core.search_dot'}" id="header_sub_menu_search_input" autocomplete="off" class="js_temp_friend_search_input" />											
													<div id="header_sub_menu_search_input"></div>
													<a href="#" onclick='$("#header_search_form").submit(); return false;' id="header_search_button">{phrase var='core.search'}</a>											
												</form>
											</div>
										</div>
									</div>	
								{/if}
							
								
								<!--{if Phpfox::isUser() && !Phpfox::getUserBy('profile_page_id')}
								<div id="nb_features">
									<a href="#" id="nb_features_link">Features</a>
									<div id="nb_features_holder">
										{assign var='bNoAppsMenu' value=true}									
										{menu}
									</div>								
								</div>
								{/if}-->
								
								<div id="header_menu_holder">
									{if Phpfox::isUser()}
									{menu_account}
                                    <div class="clear"></div>	
									{else}
									{module name='user.login-header'}
									{/if}							
								</div>	
								
								{if Phpfox::isUser() && !Phpfox::getUserBy('profile_page_id')}
								<div id="holder_notify">																	
									{notification}
									<div class="clear"></div>
								</div>
								{/if}						
								
									
																				
							</div>					
						</div>
                    	<div class="clr"></div>
					</div>
                    {block location='4'}
				</div>		
			</div>
			
			<div id="nb_body">		
				<div id="{if Phpfox::isUser()}main_core_body_holder{else}main_core_body_holder_guest{/if}">		
					{block location='11'}
					<div id="main_content_holder">	
					{/if}
                    
						<div {holder_name}>		
							<div {is_page_view} class="{if Phpfox::isUser()} is_user {else} not_user {/if} holder{if (defined('PHPFOX_IS_USER_PROFILE_INDEX') || defined('PHPFOX_IS_PAGES_IS_INDEX')) && Phpfox::getService('profile')->timeline()} js_is_profile_timeline{/if}">	
								                              
								{module name='profile.logo'}                                
								{if $aCoverPhoto.photo_id>0}
                                {else}
                                {if Phpfox::getLib('module')->getFullControllerName() == 'profile.index'}
                               		<div class="no_photo_holder_image"></div>
                                {/if}
                                {/if}
								<div id="content_holder"{if isset($sMicroPropType)} itemscope itemtype="http://schema.org/{$sMicroPropType}"{/if}>
									{block location='13'}
									{block location='7'}				
									{if !defined('PHPFOX_IS_USER_PROFILE') && !defined('PHPFOX_IS_PAGES_VIEW')}
									
									{block location='12'}
									{/if}
		
									{if !$bUseFullSite}		
									{if defined('PHPFOX_IN_DESIGN_MODE') && Phpfox::getService('profile')->timeline()}
									
									{else}
                                    {if Phpfox::getLib('module')->getFullControllerName() == 'user.browse'}			
									<div id="left">
									
										{if defined('PHPFOX_IS_USER_PROFILE') || defined('PHPFOX_IS_PAGES_VIEW') || !Phpfox::isUser()}
										{menu_sub}
										{block location='1'}																
										{else}
										<div id="nb_name">
											<div class="nb_name_image">
												{$sUserProfileImage}
											</div>
											<div class="nb_name_info">
												<a href="{$sUserProfileUrl}" class="nb_name_link">{$sCurrentUserName}</a>
												<div class="nb_name_edit">
													<a href="{url link='user.profile'}">{phrase var='theme.edit_profile'}</a>
												</div>
											</div>
										</div>
										{if Phpfox::getLib('module')->getFullControllerName() != 'core.index-member'}
										<div id="nb_favorites" class="block">
											<div class="title">
												<a href="#" class="nb_edit_block_title">{phrase var='theme.edit'}</a>
												{phrase var='theme.favorites'}
											</div>
											<div id="nb_main_menu">
												{assign var='iTotalHide' value=8}
												{menu}
											</div>		
										</div>
                                        {/if}	
										
										{if Phpfox::getLib('module')->getFullControllerName() != 'core.index-member'}										
										{menu_sub}
										{block location='1'}
										
										 custom theme <a href="{url link='core.index-member.customize'}" class="no_ajax_link nb_customize_dash">{phrase var='core.customize_dashboard'}</a>
										
										{/if}								
															
										{/if}
										
									</div>
                                    {/if}	
									{/if}				
									{/if}
		
									<div id="main_content">
												
										{if !defined('PHPFOX_IS_USER_PROFILE') && !defined('PHPFOX_IS_PAGES_VIEW')}
										{breadcrumb}
										{search}
										{/if}
										<div id="main_content_padding">
		
											{if defined('PHPFOX_IS_USER_PROFILE') || defined('PHPFOX_IS_PAGES_VIEW') || (isset($aPage) && isset($aPage.use_timeline) && $aPage.use_timeline)}
											    {if $bLoadedProfileHeader = true}{/if}
											    {module name='profile.header'}
											{/if}
											{if defined('PHPFOX_IS_PAGES_VIEW') && !isset($bLoadedProfileHeader)}
											    {block location='12'}
											    {module name='pages.header'}
											{/if}							
		
											<div id="content_load_data">
												{if isset($bIsAjaxLoader) || defined('PHPFOX_IS_USER_PROFILE') || defined('PHPFOX_IS_PAGES_VIEW')}
												{search}
												{/if}								
		
												{if isset($aBreadCrumbTitle) && count($aBreadCrumbTitle)}
												<h1>{$aBreadCrumbTitle[0]|clean|split:30}</h1>
												{/if}
		
												<div id="content" {content_class}>
													
													{error}
													<div id="column-left">{block location='2'}</div>
                                                    {*<div id="column-right"></div>*}
													{content}
													<!--{block location='4'}-->
															
												</div>
		
												
												{if !$bUseFullSite}
												
												<div id="right">
													{if !Phpfox::isUser() || Phpfox::getLib('module')->getFullControllerName() == 'core.index-member'|| defined('PHPFOX_IS_USER_PROFILE') || defined('PHPFOX_IS_PAGES_VIEW')}
													{block location='1'}
													{else}
													{menu_sub}
													{block location='1'}
													{/if}						
													{unset var=$aMenu}	

													{if Phpfox::isUser()}
													{block location='3'}
													{else}
                                                   		{block location='3'}
                                                    {/if}
												</div>
												
												{/if}												
		
												<div class="clear"></div>							
											</div>												
										</div>				
									</div>
									<div class="clear"></div>			
								</div>		
								{block location='8'}
								
								
							</div>							
						</div>			
					{if !PHPFOX_IS_AJAX_PAGE}
					</div>
					
					
									
					<div class="clfooter-custom">
						<div class="item-footer">
							<div id="nb_footer">
								{menu_footer}					
								<div id="nb_copyright">
									
									
									Copyright &copy; 2013 Hahello. All rights reserved.
								</div>				
								{block location='5'}
							</div>
							
							<div class="countercl">	
								{counter}
							</div>
							<div class="clr"></div>			
						</div>
					</div>
					{footer}		
				</div>		
			</div>
			
			
					
		</div>
		
		  {if Phpfox::isUser()}
		  <script type="text/javascript" src="arrowchat/external.php?type=djs" charset="utf-8"></script>
		  <script type="text/javascript" src="arrowchat/external.php?type=js" charset="utf-8"></script> 	  
		  
		 
		  
		  {/if}	
          {php}
            if($_REQUEST['token']!='') {
            	$token = utf8_decode(base64_decode($_REQUEST['token']));
                $arrAccount = explode("/",$token);
                                            
                echo '<script>                	
                $(document).ready(function(e) {           	
                	
                    $("#loginemail").val("'.$arrAccount[0].'");
					$("#loginpassword").val("'.$arrAccount[1].'");
					$("#viewprofile").val("'.$arrAccount[2].'");
					$("#namemember").val("'.$arrAccount[3].'");
					$("#loginform").submit();
					
			    });
                </script>';
            }
        {/php}
<div id="dialog" style="display:none;">
<iframe id="framepopup" frameborder="0" scrolling="yes" width="1020" height="450" src=""></iframe>
</div>
{copyright}

</body>
</html>
{/if}